Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added [sch_componet_name and MPN] to createSvgObjectsFromSchematicComponentWithBox fn #153

Merged
merged 6 commits into from
Dec 23, 2024

Conversation

AnasSarkiz
Copy link
Member

@AnasSarkiz AnasSarkiz commented Dec 21, 2024

/closes #152
/claim #152

Copy link

vercel bot commented Dec 21, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
circuit-to-svg ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 22, 2024 5:30am

Copy link
Contributor

@seveibar seveibar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well the text is being created twice now right- so you'll want to conditionally avoid rendering it in the second place

tests/sch/transform-attribute.test.tsx Outdated Show resolved Hide resolved
@AnasSarkiz
Copy link
Member Author

well the text is being created twice now right- so you'll want to conditionally avoid rendering it in the second place

@seveibar

else if (elm.type === "schematic_text") {
      const schComponents= su(circuitJson).schematic_component.get(elm.schematic_component_id)
      if(!schComponents) {
        schText.push(createSvgSchText(elm, transform))
      }
    }

@seveibar
Copy link
Contributor

Yea something like that @AnasSarkiz, although i think the existence of the id is probably enough- no need to search for the schComponent which is a bit expensive computationally

@tscircuitbot
Copy link

Size Report

Bundle Size

  • Base branch size: 336K
  • PR branch size: 340K
  • Difference: +4

Install Size

  • Base branch size: 10.65mb
  • PR branch size: 10.78mb
  • Difference: +.13

Full Howfat Output (PR Branch)

[email protected] (28 deps, 10.78mb, 1336 files, ©undefined)
╭───────────────────────────────┬──────────────┬──────────┬───────┬───────────┬─────────┬───────────╮
│ Name                          │ Dependencies │     Size │ Files │ Native    │ License │ Deprec    │
├───────────────────────────────┼──────────────┼──────────┼───────┼───────────┼─────────┼───────────┤
│ @tscircuit/[email protected] │            2 │ 995.31kb │    73 │           │ ISC     │           │
├───────────────────────────────┼──────────────┼──────────┼───────┼───────────┼─────────┼───────────┤
│ @tscircuit/[email protected]      │            7 │   1.86mb │   453 │           │ ISC     │           │
├───────────────────────────────┼──────────────┼──────────┼───────┼───────────┼─────────┼───────────┤
│ @tscircuit/[email protected]   │            1 │ 329.98kb │    31 │           │ ISC     │           │
├───────────────────────────────┼──────────────┼──────────┼───────┼───────────┼─────────┼───────────┤
│ @types/[email protected]           │            1 │   2.26mb │   117 │           │ MIT     │           │
├───────────────────────────────┼──────────────┼──────────┼───────┼───────────┼─────────┼───────────┤
│ [email protected]              │            5 │   5.49mb │   511 │           │ MIT     │           │
├───────────────────────────────┼──────────────┼──────────┼───────┼───────────┼─────────┼───────────┤
│ [email protected]                  │            7 │ 123.63kb │    41 │           │ MIT     │           │
├───────────────────────────────┼──────────────┼──────────┼───────┼───────────┼─────────┼───────────┤
│ [email protected]  │              │ 430.45kb │    56 │           │ MIT     │           │
╰───────────────────────────────┴──────────────┴──────────┴───────┴───────────┴─────────┴───────────╯

@tscircuitbot
Copy link

Size Report

Bundle Size

  • Base branch size: 336K
  • PR branch size: 340K
  • Difference: +4

Install Size

  • Base branch size: 10.65mb
  • PR branch size: 10.77mb
  • Difference: +.12

Full Howfat Output (PR Branch)

[email protected] (28 deps, 10.77mb, 1337 files, ©undefined)
╭───────────────────────────────┬──────────────┬──────────┬───────┬───────────┬─────────┬───────────╮
│ Name                          │ Dependencies │     Size │ Files │ Native    │ License │ Deprec    │
├───────────────────────────────┼──────────────┼──────────┼───────┼───────────┼─────────┼───────────┤
│ @tscircuit/[email protected] │            2 │ 995.31kb │    73 │           │ ISC     │           │
├───────────────────────────────┼──────────────┼──────────┼───────┼───────────┼─────────┼───────────┤
│ @tscircuit/[email protected]      │            7 │   1.86mb │   453 │           │ ISC     │           │
├───────────────────────────────┼──────────────┼──────────┼───────┼───────────┼─────────┼───────────┤
│ @tscircuit/[email protected]   │            1 │ 329.98kb │    31 │           │ ISC     │           │
├───────────────────────────────┼──────────────┼──────────┼───────┼───────────┼─────────┼───────────┤
│ @types/[email protected]           │            1 │   2.26mb │   117 │           │ MIT     │           │
├───────────────────────────────┼──────────────┼──────────┼───────┼───────────┼─────────┼───────────┤
│ [email protected]              │            5 │   5.49mb │   511 │           │ MIT     │           │
├───────────────────────────────┼──────────────┼──────────┼───────┼───────────┼─────────┼───────────┤
│ [email protected]                  │            7 │ 123.63kb │    41 │           │ MIT     │           │
├───────────────────────────────┼──────────────┼──────────┼───────┼───────────┼─────────┼───────────┤
│ [email protected]  │              │ 430.45kb │    56 │           │ MIT     │           │
╰───────────────────────────────┴──────────────┴──────────┴───────┴───────────┴─────────┴───────────╯

@tscircuitbot
Copy link

Size Report

Bundle Size

  • Base branch size: 336K
  • PR branch size: 340K
  • Difference: +4

Install Size

  • Base branch size: 10.65mb
  • PR branch size: 10.77mb
  • Difference: +.12

Full Howfat Output (PR Branch)

[email protected] (28 deps, 10.77mb, 1340 files, ©undefined)
╭───────────────────────────────┬──────────────┬──────────┬───────┬───────────┬─────────┬───────────╮
│ Name                          │ Dependencies │     Size │ Files │ Native    │ License │ Deprec    │
├───────────────────────────────┼──────────────┼──────────┼───────┼───────────┼─────────┼───────────┤
│ @tscircuit/[email protected] │            2 │ 995.31kb │    73 │           │ ISC     │           │
├───────────────────────────────┼──────────────┼──────────┼───────┼───────────┼─────────┼───────────┤
│ @tscircuit/[email protected]      │            7 │   1.86mb │   453 │           │ ISC     │           │
├───────────────────────────────┼──────────────┼──────────┼───────┼───────────┼─────────┼───────────┤
│ @tscircuit/[email protected]   │            1 │ 329.98kb │    31 │           │ ISC     │           │
├───────────────────────────────┼──────────────┼──────────┼───────┼───────────┼─────────┼───────────┤
│ @types/[email protected]           │            1 │   2.26mb │   117 │           │ MIT     │           │
├───────────────────────────────┼──────────────┼──────────┼───────┼───────────┼─────────┼───────────┤
│ [email protected]              │            5 │   5.49mb │   511 │           │ MIT     │           │
├───────────────────────────────┼──────────────┼──────────┼───────┼───────────┼─────────┼───────────┤
│ [email protected]                  │            7 │ 123.63kb │    41 │           │ MIT     │           │
├───────────────────────────────┼──────────────┼──────────┼───────┼───────────┼─────────┼───────────┤
│ [email protected]  │              │ 430.45kb │    56 │           │ MIT     │           │
╰───────────────────────────────┴──────────────┴──────────┴───────┴───────────┴─────────┴───────────╯

@tscircuitbot
Copy link

Size Report

Bundle Size

  • Base branch size: 336K
  • PR branch size: 340K
  • Difference: +4

Install Size

  • Base branch size: 10.65mb
  • PR branch size: 10.77mb
  • Difference: +.12

Full Howfat Output (PR Branch)

[email protected] (28 deps, 10.77mb, 1341 files, ©undefined)
╭───────────────────────────────┬──────────────┬──────────┬───────┬───────────┬─────────┬───────────╮
│ Name                          │ Dependencies │     Size │ Files │ Native    │ License │ Deprec    │
├───────────────────────────────┼──────────────┼──────────┼───────┼───────────┼─────────┼───────────┤
│ @tscircuit/[email protected] │            2 │ 995.31kb │    73 │           │ ISC     │           │
├───────────────────────────────┼──────────────┼──────────┼───────┼───────────┼─────────┼───────────┤
│ @tscircuit/[email protected]      │            7 │   1.86mb │   453 │           │ ISC     │           │
├───────────────────────────────┼──────────────┼──────────┼───────┼───────────┼─────────┼───────────┤
│ @tscircuit/[email protected]   │            1 │ 329.98kb │    31 │           │ ISC     │           │
├───────────────────────────────┼──────────────┼──────────┼───────┼───────────┼─────────┼───────────┤
│ @types/[email protected]           │            1 │   2.26mb │   117 │           │ MIT     │           │
├───────────────────────────────┼──────────────┼──────────┼───────┼───────────┼─────────┼───────────┤
│ [email protected]              │            5 │   5.49mb │   511 │           │ MIT     │           │
├───────────────────────────────┼──────────────┼──────────┼───────┼───────────┼─────────┼───────────┤
│ [email protected]                  │            7 │ 123.63kb │    41 │           │ MIT     │           │
├───────────────────────────────┼──────────────┼──────────┼───────┼───────────┼─────────┼───────────┤
│ [email protected]  │              │ 430.45kb │    56 │           │ MIT     │           │
╰───────────────────────────────┴──────────────┴──────────┴───────┴───────────┴─────────┴───────────╯

@AnasSarkiz
Copy link
Member Author

Yea something like that @AnasSarkiz, although i think the existence of the id is probably enough- no need to search for the schComponent which is a bit expensive computationally

@seveibar

 if (!elm.schematic_component_id.includes("schematic_component")) {
        schText.push(createSvgSchText(elm, transform))
      }
      

@seveibar
Copy link
Contributor

@AnasSarkiz that doesn't really make sense, just the existence of elm.schematic_component_id i.e. if (elm.schematic_component_id) means that it should be rendered within the schematic component group

@tscircuitbot
Copy link

Size Report

Bundle Size

  • Base branch size: 336K
  • PR branch size: 340K
  • Difference: +4

Install Size

  • Base branch size: 10.65mb
  • PR branch size: 10.77mb
  • Difference: +.12

Full Howfat Output (PR Branch)

[email protected] (28 deps, 10.77mb, 1341 files, ©undefined)
╭───────────────────────────────┬──────────────┬──────────┬───────┬───────────┬─────────┬───────────╮
│ Name                          │ Dependencies │     Size │ Files │ Native    │ License │ Deprec    │
├───────────────────────────────┼──────────────┼──────────┼───────┼───────────┼─────────┼───────────┤
│ @tscircuit/[email protected] │            2 │ 995.31kb │    73 │           │ ISC     │           │
├───────────────────────────────┼──────────────┼──────────┼───────┼───────────┼─────────┼───────────┤
│ @tscircuit/[email protected]      │            7 │   1.86mb │   453 │           │ ISC     │           │
├───────────────────────────────┼──────────────┼──────────┼───────┼───────────┼─────────┼───────────┤
│ @tscircuit/[email protected]   │            1 │ 329.98kb │    31 │           │ ISC     │           │
├───────────────────────────────┼──────────────┼──────────┼───────┼───────────┼─────────┼───────────┤
│ @types/[email protected]           │            1 │   2.26mb │   117 │           │ MIT     │           │
├───────────────────────────────┼──────────────┼──────────┼───────┼───────────┼─────────┼───────────┤
│ [email protected]              │            5 │   5.49mb │   511 │           │ MIT     │           │
├───────────────────────────────┼──────────────┼──────────┼───────┼───────────┼─────────┼───────────┤
│ [email protected]                  │            7 │ 123.63kb │    41 │           │ MIT     │           │
├───────────────────────────────┼──────────────┼──────────┼───────┼───────────┼─────────┼───────────┤
│ [email protected]  │              │ 430.45kb │    56 │           │ MIT     │           │
╰───────────────────────────────┴──────────────┴──────────┴───────┴───────────┴─────────┴───────────╯

@AnasSarkiz
Copy link
Member Author

@seveibar

if (elm.type === "schematic_text" && !elm.schematic_component_id) {
      schText.push(createSvgSchText(elm, transform))
    }
    

@seveibar
Copy link
Contributor

Maybe? Id have to see it in the pr....

@AnasSarkiz
Copy link
Member Author

@seveibar
already did

Screenshot 2024-12-23 at 7 35 20 AM

@seveibar seveibar merged commit 956dea5 into tscircuit:main Dec 23, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The reference designator isn't inside the schematic component group
3 participants